home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Small Eiffel 0.4.8 / lib_show / bench4 / bench.e < prev    next >
Encoding:
Text File  |  1997-04-13  |  900 b   |  48 lines  |  [TEXT/ttxt]

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. deferred class BENCH
  5.    --
  6.    -- Comparison : `add_last' for  ARRAY, FIXED_ARRAY, LINK_LIST 
  7.    --                              and LINK2_LIST.
  8.    --
  9.  
  10. feature
  11.  
  12.    -- According to the power of your computer, set `tuning'
  13.    -- to a good positive value. Default is for very small 
  14.    -- computer :
  15.    tuning: INTEGER is 1; -- 600000;
  16.  
  17. feature {NONE}
  18.  
  19.    frozen bench(cltn: COLLECTION[INTEGER]) is
  20.       require
  21.      cltn.count = 0
  22.       local
  23.      i: INTEGER;
  24.       do
  25.      from
  26.         i := tuning + 1;
  27.      until
  28.         i = 0
  29.      loop
  30.         cltn.add_last(i);
  31.         i := i - 1;
  32.      end;
  33.      debug
  34.         from
  35.            i := cltn.upper - 1;
  36.         until
  37.            i < cltn.lower
  38.         loop
  39.            check
  40.           cltn.item(i) = cltn.item(i + 1) + 1
  41.            end;
  42.            i := i - 1;
  43.         end;
  44.      end;
  45.       end;
  46.  
  47. end
  48.